<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('下级单位列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row" id="deptdetail">

            <!--登录信息-->
            <input name="userid" th:value="${session.userid}" type="hidden" id="userid">
            <input name="username" th:value="${session.username}" type="hidden" id="username">
            <input name="deptid" th:value="${session.deptid}" type="hidden" id="deptid">
            <input name="olddeptid" th:value="${session.olddeptid}" type="hidden" id="olddeptid">

            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>单位名称：</label>
                                <input type="text" v-model="jigoumingcheng"/>
                            </li>
<!--                            <li>
                                <label>机构代码：</label>
                                <input type="text" v-model="jigoudaima"/>
                            </li>-->
                            <li>
                                <label>单位类型：</label>
                                <select name="jigouleixing" th:with="type=${@dict.getType('sys_jigouleixing')}" v-model="jigouleixing" class="form-control" type="text">
                                    <option value="">请选择</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" @click="bindDeptList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">

                <div class="btn-group-sm" id="toolbar" role="group" style="height: 50px;line-height: 50px;">
                    <a class="btn btn-success" @click="toAdd()">
                        <i class="fa fa-plus"></i> 添加
                    </a>
                </div>

                <table class="table table-hover table-primary table-striped">
                    <thead>
                        <tr>
                            <th style="text-align: center; vertical-align: middle;">序号</th>
                            <!--<th style="text-align: center; vertical-align: middle;">机构代码</th>-->
                            <th style="text-align: center; vertical-align: middle;">单位名称</th>
                            <th style="text-align: center; vertical-align: middle;">单位类型</th>
                            <th style="text-align: center; vertical-align: middle;">地区</th>
                            <th style="text-align: center; vertical-align: middle;">负责人</th>
                            <th style="text-align: center; vertical-align: middle;">负责人办公电话</th>
                            <th style="text-align: center; vertical-align: middle;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="(deptitem,index) in deptlist"  v-if="deptlist.length > 0">
                            <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                            <!--<td style="vertical-align: middle; text-align: center;" v-text="deptitem.jigoudaima"></td>-->
                            <td style="vertical-align: middle; text-align: center;" v-text="deptitem.jigoumingcheng"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="deptitem.jigouleixing_text"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="deptitem.diqu"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="deptitem.fuzeren"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="deptitem.fuzerenbangongdianhua"></td>
                            <td style="vertical-align: middle; text-align: center;" v-text="">
                                <button class="btn btn-warning btn-rounded btn-sm" @click="toModify(deptitem.id)">修改</button>
                                <button class="btn btn-default btn-rounded btn-sm" @click="showUser(deptitem.id)">人员管理</button>
                            </td>
                        </tr>
                    <tr v-if="deptlist.length == 0">
                        <td style="text-align: center; vertical-align: middle" colspan="7">查无数据</td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <!-- 编辑单位信息 -->
            <div th:replace="system/deptdetail/modal_edit::dept_edit"></div>
            <!-- 管理单位人员 -->
            <div th:replace="system/deptdetail/modal_user::user_manage"></div>

        </div>
    </div>
    <th:block th:include="include :: footer" />
     <script th:src="@{/js/system/deptdetail/customdeptdetail.js?v=1.0}"></script>

</body>
</html>